﻿<local:DocumentBase x:Class="WPFExcelReport.AB45MATERIAL"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                      
                    Loaded="Window_Loaded"
                    xmlns:db="clr-namespace:ReflectionStudio.Core.Database;assembly=ReflectionStudio.Core"
                    Title="Planning"  
                    HorizontalAlignment="Stretch"  Margin="0,0,0,0"  VerticalAlignment="Stretch"
     >
    <local:DocumentBase.Resources>
        <db:INTEXDataSet x:Key="iNTEXDataSet" />
        <!--CollectionViewSource x:Key="wASTAMMViewSource" Source="{Binding Path=WASTAMM, Source={StaticResource iNTEXDataSet}}" /-->
        <CollectionViewSource x:Key="aBPOSViewSource" Source="{Binding Path=ABPOS, Source={StaticResource iNTEXDataSet}}" />
    </local:DocumentBase.Resources>
    <Grid DataContext=""  HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <WrapPanel Grid.Row="0" Name="zoneCommand" Height="34" Margin="0,0,0,6">
            <Button  Content="查询"  Height="23" HorizontalAlignment="Left" Margin="10,0,0,0" Name="btnQuery"
                            VerticalAlignment="Center" Width="75" Click="btnQuery_Click" />
            <Button Content="仅生成报表"  Height="23" HorizontalAlignment="Left" Margin="10,0,0,0" Name="btnReport"
                            VerticalAlignment="Top" Width="75"
                                Click="btnReport_Click" />
            <Button Content="打印报表" Height="23" Margin="10,0,0,0"  Name="btnPrint" Width="90" Click="btnPrint_Click"/>
            <Button Content="浏览数据" Height="23" Margin="10,0,0,0"  Name="btnPrintPreview" Width="90" Click="btnPrintPreview_Click"/> 
        </WrapPanel>
        <StackPanel Grid.Row="1" >
            <Expander Header="查询条件" Name="zoneQueryCond"  IsExpanded="True" ExpandDirection="Up"
                      HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
                <Grid >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0" >
                        <WrapPanel>
                            <Label Content="生产单号码:"    Width="120" HorizontalAlignment="Left" Margin="3"  FontSize="18" VerticalAlignment="Center" />
                            <TextBox Name="txtKRS" Width="30" HorizontalAlignment="Left" Background="Pink" FontSize="18" Text=""  CharacterCasing="Upper" AcceptsTab="False" MaxLength="2" />
                            <TextBox Name="txtLFD" Width="90" HorizontalAlignment="Left" Background="Beige" Text="" FontSize="18" Height="30" AcceptsTab="False" CharacterCasing="Upper" MaxLength="6" Panel.ZIndex="1" />
                            <TextBox Name="txtPOS" Width="60" HorizontalAlignment="Left" Background="YellowGreen" FontSize="18" Text="" Height="30"  AcceptsTab="False" MaxLength="3" Panel.ZIndex="2" />
                            <Label Content="品种:"  Width="50"  HorizontalAlignment="Left" Margin="3"  FontSize="18" VerticalAlignment="Center" />
                            <TextBox Name="txtArticle" Text="" Width="126"  HorizontalAlignment="Left" Background="Azure" CharacterCasing="Upper" AcceptsTab="False" MaxLength="20" Panel.ZIndex="3" />
                            <CheckBox Content="未完成单" Height="15" Name="txtERLKZ" Margin="20,10,0,0" Background="WhiteSmoke" />
                        </WrapPanel>
                        <WrapPanel>
                            <Label Content="日期从"  FontSize="16" Height="30" HorizontalAlignment="Left" Margin="0,10,0,0" Name="label1" 
                       VerticalAlignment="Top" Width="66"  />
                            <TextBox Name="gsendstartdate"  Height="30"  Width="90" HorizontalAlignment="Left" Background="Azure" FontSize="14" MaxLength="8" Panel.ZIndex="4" />
                            <DatePicker Grid.Column="1" HorizontalAlignment="Left" Margin="0,10,0,0" Name="gsendstartDateChooser" VerticalAlignment="Top" Width="98" 
                                SelectedDateChanged="gsendstartDateChooser_SelectedDateChanged"/>
                            <Label  Content="至"  FontSize="16" Height="30" HorizontalAlignment="Left" Margin="5,10,0,0" Name="label2" VerticalAlignment="Top" Width="29" />
                            <TextBlock Name="gsendenddate" Height="30"  Width="83" Background="Azure" FontSize="14" Text="" />
                            <DatePicker Grid.Column="1" HorizontalAlignment="Left" Margin="0,10,0,0" Name="gsendendDateChooser" VerticalAlignment="Top" Width="92" 
                                SelectedDateChanged="gsendendDateChooser_SelectedDateChanged"/>
                            
                            <Label Content="回轴从"  FontSize="16" Height="30" HorizontalAlignment="Left" Margin="0,10,0,0" Name="label3" 
                       VerticalAlignment="Top" Width="66"  />
                            <TextBox Name="gsendstartdate1"  Height="30"  Width="81" HorizontalAlignment="Left" Background="Azure" FontSize="14" MaxLength="8" Panel.ZIndex="4" />
                            <DatePicker Grid.Column="1" HorizontalAlignment="Left" Margin="0,10,0,0" Name="gsendstartDateChooser1" VerticalAlignment="Top" Width="92" 
                                SelectedDateChanged="gsendstartDateChooser1_SelectedDateChanged"/>
                            <Label  Content="至"  FontSize="16" Height="30" HorizontalAlignment="Left" Margin="10,10,0,0" Name="label4" VerticalAlignment="Top" Width="29" />
                            <TextBlock Name="gsendenddate1" Height="30"  Width="82" Background="Azure" FontSize="14" Text="" />
                            <DatePicker Grid.Column="1" HorizontalAlignment="Left" Margin="0,10,0,0" Name="gsendendDateChooser1" VerticalAlignment="Top" Width="94" 
                                SelectedDateChanged="gsendendDateChooser1_SelectedDateChanged"/>
                        </WrapPanel>
                    </StackPanel>
                </Grid>
            </Expander>
            <Expander Header="数据" Name="zoneDataList"  IsExpanded="True"
                      HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
                <fd:FilteringDataGrid AutoGenerateColumns="False" EnableRowVirtualization="True"  
                                            ItemsSource="{Binding Path=YABPOS}" 
                                              x:Name="MasterDg" 
                                              CanUserReorderColumns="True"  
                                             CanUserResizeRows="True"
                                              CanUserSortColumns="True"
                                              IsFilteringCaseSensitive="False" 
                                              RowDetailsVisibilityMode="VisibleWhenSelected"   
                                              Width="1000"
                                              Height="500" 
                                              EnableColumnVirtualization="True"  
                                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                                              SelectionChanged="ItemsControls_SelectionChanged"
                                              >
                    <DataGrid.Columns>
                        <!--SFACTORY,ABPSTARTDAT,ORDERNO,ARTICLE,BSFBEZ,ORDERMTR,WFACTORY,ABPERLDAT,
                            ACTMTR,BATCHNO,GAART,GAVAR,DES,GAFARBE,COLORDES,GQTY,ALLOKG,SOLLKG,ACTKG,SUPPLIER-->
                        <DataGridTextColumn  Binding="{Binding Path=SFACTORY}" Header="浆纱厂" MinWidth="40" Width="SizeToCells"  />
                        <!--DataGridTextColumn  Binding="{Binding Path=ABPSTARTDAT}" Header="排浆日期" MinWidth="40" Width="SizeToCells"  /-->
                        <DataGridTextColumn Binding="{Binding Path=ORDERNO}" Header="订单号" MinWidth="60" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=ARTICLE}" Header="品种" MinWidth="60" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=BSFBEZ}" Header="浆纱颜色" MinWidth="60" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=BQTY}" Header="下单轴数" MinWidth="30" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=ORDERMTR}" Header="下单数" MinWidth="40" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=WFACTORY}" Header="织厂" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=ABPENDDAT}" Header="预计回轴" MinWidth="40" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=ABPERLDAT}" Header="回轴日期" MinWidth="40" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=DIFF}" Header="货期差异" MinWidth="30" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=ACTMTR}" Header="实际回轴" MinWidth="40" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=BATCHNO}" Header="分缸情况" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=ABKKDAUFTNR}" Header="对色缸号" MinWidth="60" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=GAART}" Header="纱线" MinWidth="60" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=GAVAR}" Header="变量" MinWidth="20" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=DES}" Header="描述" MinWidth="40" Width="SizeToCells"  />
                        <!--DataGridTextColumn   Binding="{Binding Path=GAFARBE}" Header="色号" MinWidth="40" Width="SizeToCells"  /-->
                        <DataGridTextColumn   Binding="{Binding Path=COLORDES}" Header="颜色" MinWidth="40" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=GQTY}" Header="头份" MinWidth="40" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=ALLOKG}" Header="发纱数量" MinWidth="40" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=SOLLKG}" Header="理论用量" MinWidth="40" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=ACTKG}" Header="实际用量" MinWidth="40" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=SUPPLIER}" Header="产地" MinWidth="60" Width="SizeToCells"  />
                        
                    </DataGrid.Columns>
                </fd:FilteringDataGrid>
            </Expander>
            <!--fd:FilteringDataGrid
          Grid.Row="2"
          AutoGenerateColumns="True" EnableRowVirtualization="True"  
                                              ItemsSource="{Binding}" 
                                              x:Name="SndDg" 
                                                 CanUserReorderColumns="True"  
                                             CanUserResizeRows="True"
                                              CanUserSortColumns="True"
                                              IsFilteringCaseSensitive="False" 
                                              RowDetailsVisibilityMode="VisibleWhenSelected"   
                                              Width="1000"
                                              Height="300"
                                              EnableColumnVirtualization="True"  
                                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                                              SelectionChanged="ItemsControls_SelectionChanged"
                                              >
            </fd:FilteringDataGrid-->
        </StackPanel>
    </Grid>
</local:DocumentBase>
